#include "graduade.h"

Person::Person() : name_("Graduade"), age_(25), sex_(Human::MAN) {}

Person::Person(std::string name, Human sex=Human::MAN, int age=25) :
            name_(name), age_(age), sex_(sex){}

void Person::SetName(const std::string & name)
{
    name_ = name;
}

void Person::SetAge(int age)
{
    age_ = age;
}

void Person::SetSex(Human sex)
{
    sex_ = sex;
}

std::string Person::ShowName() const
{
    std::cout << "Name : " << name_ << std::endl;
    return name_;
}

int Person::ShowAge() const
{
    std::cout << "Age : " << age_ << std::endl;
    return age_;
}

Human Person::ShowSex() const
{
    if(Human::MAN==sex_){
        std::cout << "Grender : " << "MAN" << std::endl;
    }
    else if(Human::FEMAL==sex_){
        std::cout << "Grender : " << "FEMAL" << std::endl;
    }
    return sex_;
}

void Person::Show() const
{
    ShowName();
    ShowSex();
    ShowAge();
}

DateTime::DateTime(){};

DateTime::DateTime(int year, int month=6, int day=1):year_(year), month_(month), day_(day){};

void DateTime::SetYear(int year)
{
    year_ = year;
}

void DateTime::SetMonth(int month)
{
    month_ = month;
}

void DateTime::SetDay(int day)
{
    day_ = day;
}

int DateTime::ShowYear() const
{
    std::cout << year_ << std::endl;
    return year_;
}

int DateTime::ShowMonth() const
{
    std::cout << month_ << std::endl;
    return month_;
}

int DateTime::ShowDay() const
{
    std::cout << day_ << std::endl;
    return day_;
}

void DateTime::Show() const
{
    std::cout << year_ << "/" << month_ << "/" << day_ << std::endl;
}

Graduade::Graduade():Person(), id_(-1),major_("None"){}

Graduade::Graduade(const std::string &name, Human sex, int age, int id, std::string major) :
                Person(name, sex, age), id_(id), major_(major)
{
    admi_.SetYear(2020);
};

void Graduade::SetId(int id) 
{
    id_ = id;
}

void Graduade::SetMajor(std::string major)
{
    major_ = major;
}

void Graduade::SetAdmi(int year, int month=9, int day=1){
    admi_.SetYear(year);
    admi_.SetMonth(month);
    admi_.SetDay(day);
}

int Graduade::ShowId() const
{
    std::cout << "ID : " << id_ << std::endl;
    return id_;
}

std::string Graduade::ShowMajor() const
{
    std::cout << "Major : " << major_ << std::endl;
    return major_;
}

void Graduade::Show() const
{
    ShowName();
    ShowSex();
    ShowAge();
    ShowId();
    ShowMajor();
    std::cout << "Admission Time : ";
    admi_.Show();
}
